Skip to content
This repository was archived by the owner on Oct 17, 2026. It is now read-only.

feat(settings): find System Settings by topic and keyword - #3

Merged
oddurs merged 1 commit into
mainfrom
feat/settings-topics
Oct 16, 2026
Merged

oddurs merged 1 commit into
mainfrom
feat/settings-topics

Conversation

@oddurs

@oddurs oddurs commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Problem

A ranking audit against the real catalog on this Mac found that Settings search was too shallow:

  • "batt" found no Battery pane. Its only names are PowerPreferences and nothing localised, so the name filter dropped it.
  • "dark" and "dark mode" found nothing; the word lives in Appearance's keywords, not its name.
  • "gc" put Game Center (a pane) above Google Chrome on a tie.

Approach

  • Each pane's searchTermsFileName points at the plist System Settings' own search uses. Every entry becomes a topic (Battery, Low Power Mode, Turn firewall on or off) with its index words as keywords. A topic named like its pane only lends the pane its keywords. portableOnly/desktopOnly entries follow whether the Mac has an internal battery (IOKit power sources).
  • Keywords match from the start of the keyword or of any of its words, never fuzzily, so 700 topics with a dozen keywords each stay cheap. A keyword match scores below a name that starts the same way.
  • Topics weigh -12, so they never push an app they merely resemble off the top: "set" is still System Settings and "sa" still Safari, Slack.
  • App weight goes from 2 to 3: "gc" → Google Chrome, while "blue" still ties Bluetooth (pane) with Bluetooth File Exchange and the shorter name wins.
  • Panes that declare an SF Symbol icon (ISGraphicIconConfiguration) show it; Battery and Headphones, which don't, keep the System Settings icon.

Before / after on this Mac (top result): batt → (none) / Battery · dark mode → (none) / Appearance · low power → (none) / Low Power Mode · gc → Game Center / Google Chrome · set → System Settings / System Settings.

Look at sceptically

  • The search-terms plist is undocumented. Parsing is defensive (unknown shapes yield no topics, never a crash), but Apple can change it in any release.
  • "dark" alone still ranks Dark Noise (an Accessibility background sound) above Appearance, because a title prefix beats a keyword. Learned usage fixes it after one pick; changing the balance hurt other queries.
  • Ranking now covers ~880 candidates instead of ~200. Release builds measure 0.7–1.1 ms on the 2,000-name benchmark both before and after (interleaved A/B, no measurable change); the real catalog ranks in about 0.27 ms. The debug performance test came within 27 ms of its 40 ms budget while this machine was at load average 30–40; it's comfortably inside on an idle runner.
  • Topic deep links: every topic opens its pane, not the exact control. I haven't found a documented anchor scheme.

Checklist

  • scripts/task check passes locally
  • Ranking changes include tests showing the order they fix
  • UI changes: screenshots reviewed locally (pane icons, topic subtitles)

Searching "batt" found nothing, because the Battery pane only has an internal name, and "dark" found nothing either, because Appearance never says it. System Settings ships search-terms files for its own search; reading them gives every pane its topics and keywords, follows the macOS version, and is localised for free. Apps get a slightly larger tie-break weight so "gc" means Google Chrome, and topics rank well below apps so "set" still means System Settings.
@oddurs
oddurs merged commit 3d007f8 into main Oct 16, 2026
2 checks passed
@oddurs
oddurs deleted the feat/settings-topics branch October 16, 2026 23:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant